/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package alcatelparser.tags;

import alcatelparser.modules.BuilderFactory;
import alcatelparser.modules.I;

/**
 *
 * @author geniuz
 */
public class INSpecificInfoTag extends DefaultParserTag
{

    public INSpecificInfoTag()
    {
    }

    public final void parseTag(int ai[], int i)
    {
        setStandartLength(ai, i);/*
        _array = ai;
        if(isFullForm())
            BuilderFactory.getBuilder().writeTagContent(3, 0, getTagPropertiesValue(I.I(6636)), getTagIdentifyContent(i, i + 1));
        int j = AlgoUtil.getLength(ai, i + 1);
        int l;
        for(int k = 2; j > 0; k += l)
        {
            _currentSubPosition = i + k;
            l = 1;
            if(ai[_currentSubPosition] == 129)
                l = parseChargedParticipant();
            else
            if(ai[_currentSubPosition] == 133)
                l = parseInserviceCode();
            j -= l;
        }*/
    }

    private int parseChargedParticipant()
    {
        if(isFullForm())
        {
            String s = (new StringBuilder()).append(getTagIdentifyContent(_currentSubPosition, _currentSubPosition + 1)).append(toHex(_array[_currentSubPosition + 2])).append(I.I(5425)).append(getTagPropertiesValue((new StringBuilder()).append(I.I(6618)).append(_array[_currentSubPosition + 2]).toString())).toString();
            BuilderFactory.getBuilder().writeTagContent(4, 0, getTagPropertiesValue(I.I(1965)), s);
        } else
        if(isTagChecked(I.I(1944)))
        {
            String s1 = isFieldsDecoding() ? getTagPropertiesValue((new StringBuilder()).append(I.I(6618)).append(_array[_currentSubPosition + 2]).toString()) : toHex(_array[_currentSubPosition + 2]);
            BuilderFactory.getBuilder().writeTagContent(1, 0, getReducedTagPropertiesValue(I.I(1965)), s1);
        }
        return 3;
    }

    private int parseInserviceCode()
    {
        int i = _array[_currentSubPosition + 1];
        String s = getHexStringContent(_currentSubPosition + 2, i);
        if(isFullForm())
        {
            s = getTagIdentifyContent(_currentSubPosition, _currentSubPosition + 1);
            BuilderFactory.getBuilder().writeTagContent(4, 0, getTagPropertiesValue(I.I(6598)), s);
        } else
        if(isTagChecked(I.I(1992)))
            BuilderFactory.getBuilder().writeTagContent(1, 0, getReducedTagPropertiesValue(I.I(6598)), s);
        return i;
    }

    public final String getParseIdentityTag()
    {
        return I.I(6595);
    }

    private int _currentSubPosition;
}
